package org.vergil.core.designpattern.subject;

import java.util.*;

/**
 * Created by vergil on 17-3-19.
 */
public class Subject extends Observable {
    private int data = 0;

    public int getData() {
        return data;
    }

    public void setData(int i) {
        data = i;
        setChanged();
        //执行notifyObservers()后，它会执行uodate()方法。
        notifyObservers();
    }
}
